home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 42 / Amiga Format AFCD42 (Issue 126, Aug 1999).iso / -serious- / hardware / blizkick / modules / a1000jingle.asm < prev    next >
Assembly Source File  |  1999-05-17  |  24KB  |  586 lines

  1. ; FILE: Source:modules/A1000Jingle.ASM          REV: 2 --- Play A1000 boot-jingle
  2.  
  3. ;
  4. ; A1000-Jingle module for BlizKick
  5. ; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  6. ; Written by Harry Sintonen.
  7. ; This source code is Public Domain.
  8. ;
  9. ;
  10.  
  11.     incdir    "include:"
  12.     include    "exec/libraries.i"    ; Some required...
  13.     include    "exec/memory.i"
  14.     include    "hardware/custom.i"
  15.     include    "hardware/dmabits.i"
  16.     include    "hardware/intbits.i"
  17.     include    "exec/exec_lib.i"
  18.     include    "blizkickmodule.i"
  19.  
  20.     SECTION    MODULE,CODE
  21. _DUMMY_LABEL
  22.  BK_MOD BKMF_SingleMode,_end,(RTF_COLDSTART)<<24+37<<16+NT_UNKNOWN<<8+104,_name,_idstr,_init
  23. ;BK_MOD BKMF_SingleMode,_end,(RTF_COLDSTART)<<24+37<<16+NT_UNKNOWN<<8+$FF,_name,_idstr,_init
  24.  
  25. ; Singlemode on,
  26. ; COLDSTART module, requires KS V37.x or better, module type NT_UNKNOWN, priority 104.
  27.  
  28. SAM_LEN    EQU    7470
  29. SAM_FREQ    EQU    8363
  30. SAM_SAMPLES    EQU    SAM_LEN/2
  31. SAM_PERIOID    EQU    125000/SAM_FREQ*355871/10000
  32.  
  33. _init    movem.l    d0-a6,-(sp)
  34.     move.l    (4).w,a6
  35.     lea    $DFF000,a5
  36.  
  37.     move.l    #SAM_LEN,d0
  38.     moveq    #MEMF_CHIP,d1
  39.     jsr    (_LVOAllocMem,a6)
  40.     tst.l    d0
  41.     beq    .exit
  42.     move.l    d0,a2
  43.  
  44.     lea    (Sample,pc),a0
  45.     move.l    a2,a1
  46.     move.l    #SAM_LEN,d0
  47.     jsr    (_LVOCopyMem,a6)
  48.  
  49.     move.w    #INTF_AUD0!INTF_AUD1!INTF_AUD2!INTF_AUD3,(intena,a5)    ; Disable audio ints
  50.     move.w    #DMAF_AUD0!DMAF_AUD1!DMAF_AUD2!DMAF_AUD3,(dmacon,a5)    ; Stop audio DMA
  51.     move.w    #$00FF,(adkcon,a5)                    ; No modulation
  52.  
  53.     moveq    #0,d0            ; Volume to zero
  54.     lea    (aud+ac_vol,a5),a0
  55.     bsr    .setall
  56.  
  57.     move.w    #SAM_SAMPLES,d0        ; Set sample len
  58.     lea    (aud+ac_len,a5),a0
  59.     bsr.b    .setall
  60.  
  61.     move.w    #SAM_PERIOID,d0        ; Set sample perioid
  62.     lea    (aud+ac_per,a5),a0
  63.     bsr.b    .setall
  64.  
  65.     move.l    a2,(aud0+ac_ptr,a5)    ; Set sample addr
  66.     move.l    a2,(aud1+ac_ptr,a5)
  67.     move.l    a2,(aud2+ac_ptr,a5)
  68.     move.l    a2,(aud3+ac_ptr,a5)
  69.  
  70.     moveq    #64,d0            ; Set full volume
  71.     lea    (aud+ac_vol,a5),a0
  72.     bsr.b    .setall
  73.  
  74.  
  75.     move.w    #INTF_AUD0!INTF_AUD1!INTF_AUD2!INTF_AUD3,(intreq,a5)    ; Kill possible pending intreqs
  76.  
  77.     ; Enable audio DMA
  78.     move.w    #DMAF_SETCLR!DMAF_AUD0!DMAF_AUD1!DMAF_AUD2!DMAF_AUD3!DMAF_MASTER,(dmacon,a5)
  79.  
  80.     moveq    #2-1,d0                ; Do two times (will play sample once)
  81. .wait    btst    #INTB_AUD0,(intreqr+1,a5)    ; Wait sample to finish
  82.     beq.b    .wait
  83.     move.w    #INTF_AUD0,(intreq,a5)        ; Kill intreq
  84.     dbf    d0,.wait
  85.  
  86.     moveq    #0,d0            ; Volume to zero
  87.     lea    (aud+ac_vol,a5),a0
  88.     bsr.b    .setall
  89.  
  90.     move.w    #DMAF_AUD0!DMAF_AUD1!DMAF_AUD2!DMAF_AUD3,(dmacon,a5)    ; Stop audio DMA
  91.     move.w    #INTF_AUD0!INTF_AUD1!INTF_AUD2!INTF_AUD3,(intreq,a5)    ; Kill pending intreqs
  92.  
  93.     move.l    a2,a1
  94.     move.l    #SAM_LEN,d0
  95.     jsr    (_LVOFreeMem,a6)
  96.  
  97. .exit    movem.l    (sp)+,d0-a6
  98.     rts
  99.  
  100. .setall    move.w    d0,(a0)
  101.     move.w    d0,(aud1-aud0,a0)
  102.     move.w    d0,(aud2-aud0,a0)
  103.     move.w    d0,(aud3-aud0,a0)
  104.     rts
  105.  
  106.  
  107. Sample    ;;INCBIN "a1000.raw"
  108.     DC.L    $00000000,$00000000,$00000000,$00000000
  109.     DC.L    $00000000,$00000000,$00000000,$00000000
  110.     DC.L    $00000000,$00000000,$00000000,$00000000
  111.     DC.L    $00000000,$00000000,$00000000,$00000000
  112.     DC.L    $00000000,$00000000,$00000000,$00000000
  113.     DC.L    $00000000,$00000000,$00000000,$00000000
  114.     DC.L    $00000000,$00000000,$00000000,$00000000
  115.     DC.L    $00000000,$00000000,$00000000,$00000000
  116.     DC.L    $00000000,$00000000,$00000000,$00000000
  117.     DC.L    $00000000,$00000000,$00000000,$00000000
  118.     DC.L    $00000000,$00000000,$00000000,$00000000
  119.     DC.L    $00000000,$00000000,$00000000,$00000000
  120.     DC.L    $00000000,$00000000,$00000000,$00000000
  121.     DC.L    $00000000,$00000000,$00000000,$00000000
  122.     DC.L    $00000000,$00000000,$F0F0F0F0,$F0F0F0F0
  123.     DC.L    $F0F0F0F0,$F0F0F0F0,$F0F0F0F0,$F0F0F0F0
  124.     DC.L    $F0F0F0F0,$ECE6DED8,$D6D4D2D2,$D2D2D2D2
  125.     DC.L    $D8E4EAEC,$EEF0F0F0,$F0F0F0F0,$F0F0F0F0
  126.     DC.L    $F0F0F0EE,$E4DAD6D4,$D2D2D2D2,$D2D8E0E8
  127.     DC.L    $ECEEF0F0,$F0F0F0F0,$F0F0F0F0,$F0F0F0F0
  128.     DC.L    $F0F0E8DE,$D8D4D2D2,$D2D2D2D6,$E2EAECEE
  129.     DC.L    $F0F0F0F0,$F0F0F0F0,$F0F0F0F0,$F0F0F0EE
  130.     DC.L    $E6DED8D4,$D2D2D2D2,$D2D2D6E0,$E8ECEEF0
  131.     DC.L    $F0F0F0F0,$F0F0F0F0,$F0F0F0F0,$F0EEE6DC
  132.     DC.L    $D6D4D2D2,$D2D2D2D2,$D8E0E8EA,$EEF0F0F0
  133.     DC.L    $F0F0F0F0,$F0F0F0F0,$F0F0F0EC,$E6DCD6D4
  134.     DC.L    $D2D2D2D2,$D2D2D6E2,$EAECF0F0,$F0F0F0F0
  135.     DC.L    $F0F0F0F0,$F0F0F0F0,$F0F0EEE8,$E0D8D6D4
  136.     DC.L    $D2D2D2D2,$DCE6EAEE,$F0F0F0F0,$F0F0F0F0
  137.     DC.L    $F0F0F0F0,$F0F0F0F0,$F0E8DCD6,$D4D2D2D2
  138.     DC.L    $D2D4DCE4,$EAEEF0F0,$F0F0F0F0,$F0F0F0F0
  139.     DC.L    $F0F0F0F0,$F0F0ECE6,$DED8D6D4,$D2D2D2D4
  140.     DC.L    $DAE2EAEC,$EEF0F0F0,$F0F0F0F0,$F0F0F0F0
  141.     DC.L    $F0F0F0F0,$E8E2DAD6,$D4D2D2D2,$D2D2D6DE
  142.     DC.L    $E8ECEEF0,$F0F0F0F0,$F0F0F0F0,$F0F0F0F0
  143.     DC.L    $F0F0ECE6,$DED8D6D4,$D2D2D2D2,$D6E2EAEC
  144.     DC.L    $EEF0F0F0,$F0F0F0F0,$F0F0F0F0,$F0F0F0F0
  145.     DC.L    $F0E8E0D8,$D6D2D2D2,$D2D2D8E0,$E8ECEEF0
  146.     DC.L    $F0F0F0F0,$F0F0F0F0,$F0F0F0F0,$F0F0F0EA
  147.     DC.L    $E2DCD6D4,$D2D2D2D2,$D2D8E4EA,$ECEEF0F0
  148.     DC.L    $F0F0F0F0,$F0F0F0F0,$F0F0F0F0,$EEE8DED8
  149.     DC.L    $D6D2D2D2,$D2D2D2DA,$E0E8ECEE,$F0F0F0F0
  150.     DC.L    $F0F0F0F0,$F0F0F0F0,$F0F0F0EA,$E2DAD6D4
  151.     DC.L    $D2D2D2D2,$D2D8E4EA,$ECEEF0F0,$F0F0F0F0
  152.     DC.L    $F0F0F0F0,$F0F0F0F0,$F0ECE6DC,$D6D4D2D2
  153.     DC.L    $D2D2D2DA,$E2EAECEE,$F0F0F0F0,$F0F0F0F0
  154.     DC.L    $F0F0F0F0,$F0F0F0EE,$E8E0D8D6,$D4D2D2D2
  155.     DC.L    $D2DAE4EA,$ECEEF0F0,$F0F0F0F0,$F0F0F0F0
  156.     DC.L    $F0F0F0F0,$F0EADED6,$D4D2D2D2,$D2D2D2D6
  157.     DC.L    $E2EAECF0,$F0F0F0F0,$F0F0F0F0,$F0F0F0F0
  158.     DC.L    $F0F0F0EE,$E8E0D8D6,$D4D2D2D2,$D2D4DEE6
  159.     DC.L    $ECEEF0F0,$F0F0F0F0,$F0F0F0F0,$F0F0F0F0
  160.     DC.L    $F0F0E8DC,$D6D4D2D2,$D2D2D2D2,$D8E4ECEE
  161.     DC.L    $F0F0F0F0,$F0F0F0F0,$F0F0F0F0,$F0F0F0F0
  162.     DC.L    $ECE0D8D6,$D4D2D2D2,$D4DAE2EA,$ECEEF0F0
  163.     DC.L    $F0F0F0F0,$F0F0F0F0,$F0F0F0F0,$F0F0F0E8
  164.     DC.L    $E0D8D6D2,$D2D2D2D6,$DEE8ECEE,$F0F0F0F0
  165.     DC.L    $F0F0F0F0,$F0F0F0F0,$F0F0F0F0,$ECE4DCD8
  166.     DC.L    $D4D2D2D2,$D2D2D6E2,$EAECEEF0,$F0F0F0F0
  167.     DC.L    $F0F0F0F0,$F0F0F0F0,$F0F0E8E0,$D8D6D2D2
  168.     DC.L    $D2D2D2D2,$D4DEE8EC,$EEF0F0F0,$F0F0F0F0
  169.     DC.L    $F0F0F0F0,$F0F0F0F0,$E8DED8D4,$D2D2D2D2
  170.     DC.L    $D2D2D8E2,$EAECEEF0,$F0F0F0F0,$F0F0F0F0
  171.     DC.L    $F0F0F0F0,$F0F0F0F0,$F0F0F0F0,$F0F0F0F0
  172.     DC.L    $F0F0F0F0,$E8DCD6D4,$D2D2D4DC,$E8ECEEF0
  173.     DC.L    $F0F0F0F0,$F0F0F0EC,$E2DAD2CC,$C8CCD0D8
  174.     DC.L    $E2EAECEE,$F0F0F0F0,$F0F0F0F0,$E8E0DAD6
  175.     DC.L    $D2D2D2D8,$E4ECEEF0,$F0F0F0F0,$F0F0F0F0
  176.     DC.L    $E8DCD6D4,$D2D2D2D8,$E6EAEEF0,$F0F0F0F0
  177.     DC.L    $F0F0F0F0,$E8DED8D6,$D4D2D2D6,$E4EAEEF0
  178.     DC.L    $F0F0F0F0,$F0F0F0F0,$ECE0D8D6,$D2D2D2D8
  179.     DC.L    $E6ECEEF0,$F0F0F0F0,$F0F0F0F0,$EEE4DAD6
  180.     DC.L    $D4D2D2D6,$E2E8ECEE,$F0F0F0F0,$F0F0F0F0
  181.     DC.L    $EEEAE0DA,$D6D4D2D4,$E0EAECEE,$F0F0F0F0
  182.     DC.L    $F0F0F0F0,$F0EADED8,$D4D2D2D2,$DCE8ECEE
  183.     DC.L    $F0F0F0F0,$F0F0F0F0,$F0ECE0D8,$D6D2D2D2
  184.     DC.L    $DAE4EAEE,$F0F0F0F0,$F0F0F0F0,$EEEAE0D8
  185.     DC.L    $D6D4D2D6,$E2EAECEE,$F0F0F0F0,$F0F0F0F0
  186.     DC.L    $F0E8DCD8,$D4D2D2D2,$D8E6ECEE,$F0F0F0F0
  187.     DC.L    $F0F0F0F0,$F0EADED8,$D4D2D2D2,$DAE6ECEE
  188.     DC.L    $F0F0F0F0,$F0F0F0F0,$F0F0EAE0,$D8D6D4D2
  189.     DC.L    $D8E4EAEC,$EEF0F0F0,$F0F0F0F0,$F0F0E4DA
  190.     DC.L    $D6D2D2D2,$D6E2EAEE,$F0F0F0F0,$F0F0F0F0
  191.     DC.L    $F0F0E6DC,$D6D4D2D2,$D4DEE8EC,$EEF0F0F0
  192.     DC.L    $F0F0F0F0,$F0F0EADE,$D8D6D4D2,$D2DAE4EA
  193.     DC.L    $ECEEF0F0,$F0F0F0F0,$F0F0EEE2,$D8D4D2D2
  194.     DC.L    $D2DEE8EE,$F0F0F0F0,$F0F0F0F0,$F0F0EAE2
  195.     DC.L    $DAD6D4D2,$D2DAE6EA,$EEF0F0F0,$F0F0F0F0
  196.     DC.L    $F0F0F0E8,$DCD8D4D2,$D2DCE6EA,$EEF0F0F0
  197.     DC.L    $F0F0F0F0,$F0F0ECE8,$DCD6D4D2,$D2D8E6EC
  198.     DC.L    $EEF0F0F0,$F0F0F0F0,$F0F0F0E8,$DCD6D4D2
  199.     DC.L    $D2D8E2E8,$ECEEF0F0,$F0F0F0F0,$F0F0EEE6
  200.     DC.L    $DCD6D4D2,$D2D6E0EA,$ECEEF0F0,$F0F0F0F0
  201.     DC.L    $F0F0F0EA,$DED6D4D2,$D2D2DCE8,$ECEEF0F0
  202.     DC.L    $F0F0F0F0,$F0F0F0EC,$E0D8D6D2,$D2D4DEE8
  203.     DC.L    $ECF0F0F0,$F0F0F0F0,$F0F0F0EE,$E2D8D6D4
  204.     DC.L    $D2D2D8E2,$EAECEEF0,$F0F0F0F0,$F0F0F0F0
  205.     DC.L    $E6DAD6D4,$D2D2DEE8,$ECEEF0F0,$F0F0F0F0
  206.     DC.L    $F0F0F0F0,$E8DCD6D4,$D2D2DAE6,$ECEEF0F0
  207.     DC.L    $F0F0F0F0,$F0F0F0EC,$E6DED8D6,$D4D2D8E4
  208.     DC.L    $EAECEEF0,$F0F0F0F0,$F0F0F0F0,$E4D8D6D2
  209.     DC.L    $D2D2D6E2,$EAEEF0F0,$F0F0F0F0,$F0F0F0F0
  210.     DC.L    $E6DAD6D4,$D2D2D4DE,$E8ECEEF0,$F0F0F0F0
  211.     DC.L    $F0F0F0F0,$EADED8D6,$D4D2D4E2,$EAECEEF0
  212.     DC.L    $F0F0F0F0,$F0F0F0F0,$EEDED6D4,$D2D2D2D8
  213.     DC.L    $E6ECEEF0,$F0F0F0F0,$F0F0F0F0,$EEE2DAD6
  214.     DC.L    $D4D2D6E0,$E8ECEEF0,$F0F0F0F0,$F0F0F0F0
  215.     DC.L    $F0E6DCD8,$D4D2D2DC,$E6EAEEF0,$F0F0F0F0
  216.     DC.L    $F0F0F0F0,$ECE6DAD6,$D4D2D2D8,$E6ECEEF0
  217.     DC.L    $F0F0F0F0,$F0F0F0F0,$EEE4DAD6,$D4D2D2D8
  218.     DC.L    $E2E8ECEE,$F0F0F0F0,$F0F0F0F0,$EEE6DCD6
  219.     DC.L    $D4D2D2D6,$E0EAECEE,$F0F0F0F0,$F0F0F0F0
  220.     DC.L    $F0F0F0F0,$F0F0F0F0,$F0F0F0F0,$F0F0F0F0
  221.     DC.L    $F0F0F0F0,$F0F0F0F0,$F0F0F0F0,$F0F0F0F0
  222.     DC.L    $F0EEE6DC,$D6D4D2CC,$C8C6CCCE,$D0D6DEE8
  223.     DC.L    $ECEEF0F0,$F0F0F0F0,$F0F0F0F0,$F0F0F0F0
  224.     DC.L    $EAE6DAD6,$D4D2D2D2,$D2D2D2D8,$E2EAEEF0
  225.     DC.L    $F0F0F0F0,$F0F0F0F0,$F0F0F0F0,$F0F0EEE4
  226.     DC.L    $DAD6D2CC,$C8C8CCCE,$D0D2DEE8,$ECEEF0F0
  227.     DC.L    $F0F0F0F0,$F0F0F0F0,$F0F0F0F0,$F0E8DCD6
  228.     DC.L    $D4D2CCCE,$D0D0D0D4,$DCE6ECEE,